{% extends "dashboard/base.html" %}

{% load trans from i18n %}

{% block title %}
  {% if object %}
    {% trans "Edit Post" %} - {{ object.title }}
  {% else %}
    {% trans "Add New Post" %}
  {% endif %}
{% endblock %}

{% block extraheads %}
  <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}js/libs/markitup/skins/simple/style.css" />
  <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}js/libs/markitup/sets/rest/style.css" />
{% endblock %}

{% block scripts %}
  <script type="text/javascript" src="{{ STATIC_URL }}js/libs/markitup/jquery.markitup.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}js/libs/markitup/sets/rest/set.js"></script>

  <script language="javascript">
    $('textarea').markItUp(restSettings);
  </script>
{% endblock %}

{% block content_class %}set-content-margin{% endblock %}

{% block content %}
  <div id="blog-form">
    <form action="" method="POST">
      <div class="control-group{% if form.title.errors %} error{% endif %}">
        {{ form.title }}
      </div>

      <div class="control-group{% if form.slug.errors %} error{% endif %}" id="slug">
        <span class="control-label">{% trans "Slug" %}:</span>
        {{ form.slug }}
      </div>

      <div class="control-group{% if form.content.errors %} error{% endif %}">
        {{ form.content }}
      </div>

      <div class="row-fluid">
        <div class="span10">
          <div class="pull-right">
            <strong>{% trans "is published?" %}</strong>
            {{ form.is_published }}
          </div>
        </div>
        <div class="span2">
          <input type="submit" class="btn btn-large btn-primary pull-right"
                 value="{% trans "Submit" %}"/>
        </div>
      </div>
    </form>
  </div>
{% endblock %}